<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .d1{
            width: 100px;
            height: 100px;
            background-color:blue;
            position: absolute;
            z-index: 2;
            /* position: absolute绝对定位后
            z-index 越大就是在最上面 */
        }
        .d2{
            width: 100px;
            height: 100px;
            background-color:red;
            position: absolute;
            margin: 10px;
            z-index: 1;
        }
        .d3{
            width: 100px;
            height: 100px;
            background-color:green;
            position: absolute;
            margin: 20px;
        }
    </style>
</head>
<body>
    <div class="d1"></div>
    <div class="d2"></div>
    <div class="d3"></div>
</body>
</html>